#!/bin/bash
# 
# This script is called with the following arguments:
#	Arg	Name			Example
#	$1	Common action		common_action
#	$2	Monitor path		/home/user1
#	$3	Relative path		/file
#	$4	Absolute path		/home/user1/file
#	$5	Is directory		YES
#	$6	Synchronize path	/home/user2
#	$7	Cookie			2348
#	$8	Temp path		/home/user2/.inotify-sync
#	$9	Custom log		../log/sample.custom.log
#	$10	Error log		../log/sample.error.log

EVENT_TYPE="MODIFY"

COMMON_ACTION="$1"
source $COMMON_ACTION

if [ "X$SYNC_PATH" != "X" ]
then
	if [ "X$IS_DIRECTORY" = "XYES" ]
	then
		cp -R $ABSOLUTE_PATH $SYNC_PATH$RELATIVE_PATH
	else
		cp $ABSOLUTE_PATH $SYNC_PATH$RELATIVE_PATH
	fi
fi
